/**
 * 
 */


function loaddata(){
	//var allFlag = $("#allFlag").val();
	//var pno = $("#pagenum").val();
	var emp_id = $("#emp_id").val();
	var ope_id=$("#ope_id_Lcm").val();
	var month= $("#month").val();
	var scope= $("#scope").val();
	var classtype= $("#classtype").val();
	
	
	var url = pms_url + "lcm/performance/getListAttendenceThisMon";
	var params = {
			emp_id:emp_id,
			ope_id:ope_id,
			month:month,
			classtype:classtype,
			scope:scope
			//pno:pno,
			//allFlag:allFlag
			};
	var obj = load(url,params);
	var attendenceArray = obj.attendence;
	$("#performanceMaintainMonlist").find("tbody").html("");
	$.each(attendenceArray, function(index, p) {
	var tr ="<tr role='row'>"+
	"<td align='center'>"+(index+1)+"</td>"+
	"<td align='center'>"+p.label+"</td>"+
	"<td align='center'>"+p.emp_id+"</td>"+
	"<td align='center'>"+p.emp_name+"</td>"+
	"<td align='center'>"+((p.shftHour==null)?"0":p.shftHour)+"</td>"+
	"<td align='center'>"+((p.attdHour==null)?"0":p.attdHour)+"</td>"+
	"<td align='center'>"+p.attendance+"</td>"+
	"</tr>";
	$("#performanceMaintainMonlist").find("tbody").append(tr);
 });
}






$(function () { 
	
	loaddata();
	$("#btnSearch").click(function(){
		loaddata();
	});
	$("#btnReset").on('click', function () {
		$("#searchform input").val("");
		$("#ope_id_Lcm").val("");
	});	
	
	
	$("#ope_id_Lcm").change(function(){
		loaddata();
	});
	
	
	
	
  });